<?php
/**
 * oscshop2 B2C电子商务系统
 *
 * ==========================================================================
 * @link      http://www.oscshop.cn/
 * @copyright Copyright (c) 2015-2017 oscshop.cn. 
 * @license   http://www.oscshop.cn/license.html License
 * ==========================================================================
 *
 *
 */
 
namespace osc\mobile\controller;
use osc\common\controller\Base;
use think\Db;
class Article extends MobileBase
{
 	function getartlist()
    {
    	$art1 = Db::name('article')->order('id desc')->where('status',1)->select();
    	$this->assign('art1', $art1);
    	$this->assign('top_title','公告栏');
		$this->assign('SEO',['title'=>'公告栏-'.config('SITE_TITLE')]);
    	return $this->fetch('getartlist');
    }

    function getartinfo()
    {
    	//var_dump(input('param.id'));
    	//die;
    	$id=input('param.id');
    	if(!is_numeric($id))
    	{
    		$this->redirect('article/getartlist');	
    	}

    	$art1 = Db::name('article')->where('id',$id)->find();
    	$img = Db::name('article_image')->where('article_id',$id)->select();
    	$this->assign('art1', $art1);
    	$this->assign('img', $img);
    	$this->assign('top_title',$art1['title']);
		$this->assign('SEO',['title'=>'公告-'.config('SITE_TITLE')]);
    	return $this->fetch('getartinfo');
    }
	
}
